﻿/**
 * 
 * @file   FITKAbaLoadPressure.h
 * @brief  压强载荷
 * @author LiJin (1003680421@qq.com)
 * @date   2024-04-08
 * 
 */
#ifndef FITKABALOADPRESSURE_H
#define FITKABALOADPRESSURE_H
#include "FITKInterfaceStructuralAPI.h"
#include "FITKAbaAbstractLoad.h"
#include "FITKAbaStepRelatedDataObject.h"

namespace Interface {
    /**
     * @brief  压强载荷数据，在个分析步中可编辑
     * @author LiJin (1003680421@qq.com)
     * @date   2024-04-08
     */
    class PressureData
    {
    public:
        /**
         * @brief  获取压强值
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-08
         */
        double getPreesure() const;
        /**
         * @brief  设置压强值
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-08
         */
        void setPressure(double value);
        /**
         * @brief  获取幅值曲线Id
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-08
         */
        int getAmplitudeId() const;
        /**
         * @brief  设置幅值曲线Id
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-08
         */
        void setAmplitudeId(int id);
    private:
        /**
         * @brief  幅值曲线Id
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-08
         */
        int m_m_AmplitudeId{0};
        /**
         * @brief  压强值
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-08
         */
        double m_value{0.0};
    };
    /**
     * @brief  压强载荷类
     * @author LiJin (1003680421@qq.com)
     * @date   2024-04-08
     */
    class FITKInterfaceStructuralAPI FITKAbaLoadPressure: public FITKAbaAbstractLoad
    {
        FITKCLASS(Interface, FITKAbaLoadPressure)
    public:
        FITKAbaLoadPressure() = default;
        ~FITKAbaLoadPressure() = default;
        FITKAbaLoadType getLoadType() const override;
        bool copy(Core::FITKAbstractDataObject* obj) override;
        bool isModifiedInStep(int stepId) const override;
        void activeStateChanged() override;
        /**
         * @brief  获取压强
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-10
         */
        double getPressure(int stepId = 0);
        /**
         * @brief  设置压强
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-10
         */
        void setPressure(double value, int stepId = 0);
        /**
         * @brief  获取幅值曲线Id
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-10
         */
        int getAmplitudeId(int stepId = 0);
        /**
         * @brief  设置幅值曲线Id
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-10
         */
        void setAmplitudeId(int id, int stepId = 0);
    private:
        /**
         * @brief  获取分析步对应的数据
         * @param[in]  
         * @return 
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-28
         */
        PressureData getDataInStep(int stepId);
    private:
        /**
         * @brief  创建数据
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-28
         */
        PressureData m_data;
        /**
         * @brief  后续分析步修改的数据
         * @author LiJin (1003680421@qq.com)
         * @date   2024-04-28
         */
        QMap<int, PressureData> m_modifiedDatas{};
    };
}


#endif // FITKABALOADPRESSURE_H
